dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}
print("dict['Name']: ", dict['Name'])
print("dict['Age']: ", dict['Age'])
# 修改字典
dict['Age'] = 56
dict['Name'] = "菜鸟教程"
print("dict['Name']: ", dict['Name'])
print("dict['Age']: ", dict['Age'])
# 删除字典里的元素
dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}
del dict['Name']  # 删除键 'Name'
dict.clear()  # 清空字典
del dict  # 删除字典
# print("dict['Age']: ", dict['Age'])执行这两个语句会引发异常，
# 因为字典已经被删除了
# print("dict['School']: ", dict['School'])
dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}
print(len(dict))
print(str(dict))
print(type(dict))
x = True
country_counter = {}

def addone(country):
    if country in country_counter:
        country_counter[country] += 1
    else:
        country_counter[country] = 1

addone('China')
addone('Japan')
addone('china')

print(len(country_counter))
confusion = {}
confusion[1] = 1
confusion['1'] = 2
confusion[1] += 1

sum = 0
for k in confusion:
    sum += confusion[k]

print(sum)